//package com.ruoyi.psi.base.warehouse.controller;
//
//
//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.utils.poi.ExcelUtil;
//import com.ruoyi.psi.base.product.domain.BaseProduce;
//import com.ruoyi.psi.base.warehouse.domain.BaseWarehouse;
//import com.ruoyi.psi.base.warehouse.service.IBaseWarehouseService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * 仓库信息
// * 视图层
// */
//@RestController
//@RequestMapping("/psi/base/warehouse")
//@Api(value = "仓库信息模块", tags = "仓库信息接口")
//public class BaseWarehouseController extends BaseController {
//    @Autowired
//    private IBaseWarehouseService baseWarehouseService;
//
//    /**
//     * 获取仓库列表
//     * @param baseWarehouse
//     * @return
//     */
//    @ApiOperationSupport(includeParameters = {"BaseWarehouse.warehouseName", "BaseWarehouse.warehouseAddress", "BaseWarehouse.staffId", "BaseWarehouse.warehouseId"})
//    @ApiOperation(value = "获取仓库列表",notes = "查询所有仓库信息")
//    @PostMapping("/list")
//    public TableDataInfo list(@RequestBody BaseWarehouse baseWarehouse){
//        startPage();
//        List<BaseWarehouse> baseWarehouseList = baseWarehouseService.selectBaseWarehouseList(baseWarehouse);
//        return getDataTable(baseWarehouseList);
//    }
//    /**
//     * 获取对应仓库产品信息
//     * @param baseWarehouse 仓库编号
//     * @return
//     */
//    @PostMapping("/getProduce")
//    public AjaxResult getProduce(@RequestBody BaseWarehouse baseWarehouse) {
//        List<BaseProduce> produceList = baseWarehouseService.getProduce(baseWarehouse.getWarehouseId());
//        return AjaxResult.success(produceList);
//    }
//    /**
//     * 导出仓库
//     * @param baseWarehouse
//     * @return
//     */
//    @PostMapping("/export")
//    public AjaxResult export(@RequestBody BaseWarehouse baseWarehouse)
//    {
//        List<BaseWarehouse> list = baseWarehouseService.selectBaseWarehouseList(baseWarehouse);
//        ExcelUtil<BaseWarehouse> util = new ExcelUtil<BaseWarehouse>(BaseWarehouse.class);
//        return util.exportExcel(list, "仓库数据");
//    }
//
//    /**
//     * 新增仓库
//     * @param baseWarehouse
//     * @return
//     */
//    @ApiOperation(value = "新增仓库", notes = "新增仓库")
//    @ApiImplicitParam(name = "baseWarehouse", value = "新增仓库", dataType = "BaseWarehouse")
//    @PostMapping("/add")
//    public AjaxResult add(@Validated @RequestBody BaseWarehouse baseWarehouse){
//
//        try {
//            return toAjax(baseWarehouseService.insertBaseWarehouse(baseWarehouse));
//        } catch (Exception e) {
//            e.printStackTrace();
//            return AjaxResult.error("新增失败");
//        }
//    }
//
//    /**
//     * 修改仓库
//     * @param baseWarehouse
//     * @return
//     */
//    @ApiOperation(value = "修改仓库", notes = "修改仓库")
//    @ApiImplicitParam(name = "baseWarehouse", value = "修改仓库", dataType = "BaseWarehouse")
//    @PostMapping("/edit")
//    public AjaxResult edit(@Validated @RequestBody BaseWarehouse baseWarehouse)
//    {
//        return toAjax(baseWarehouseService.updateBaseWarehouse(baseWarehouse));
//    }
//
//    /**
//     * 删除仓库
//     * 仅修改删除标志位
//     * @param baseWarehouse
//     * @return
//     */
//    @PostMapping("/delete")
//    public AjaxResult delete(@RequestBody BaseWarehouse baseWarehouse)
//    {
//
//        return toAjax(baseWarehouseService.updateBaseWarehouseDeleteFlag(baseWarehouse));
//    }
//}
